home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.0
/
Video Toaster v4.0.iso
/
arexx
/
switcher
/
toasterserialhost.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-12-13
|
1KB
|
39 lines
/* ToasterSerialHost.rexx -- Provide serial access to Switcher() functions */
/* This script replaces that abomination 'remote.rexx' and provides an alternative
* to the ToastNSerial program which also lets you send ARexx commands to the
* Toaster via serial port.
* By Arnie Cachelin © 1992 NewTek Inc. */
OPTIONS RESULTS
HOST_EXIT='EXIT' /* Send this string to shut down this program */
TOASTERLIB="ToasterARexx.port" /* Name of the Toaster function host port */
res=""
IF ~SHOW('Libraries',TOASTERLIB) THEN
IF ~ADDLIB(TOASTERLIB , 0) THEN x=Bummer(" Please start your Video Toaster!")
IF OPEN(SerialPort,"AUX:",'A') THEN
DO FOREVER
pktstring = READLN(SerialPort)
IF UPPER(pktstring) =HOST_EXIT THEN x=Bummer(" Received "EXIT" request.")
pktstring=TRANSLATE(STRIP(pktstring),","," ") /* replace space with comma */
FunctionCmd="res=Switcher("pktstring")"
INTERPRET FunctionCmd
IF res="SWITCHER" THEN
Writeln(SerialPort,"OK")
ELSE
Writeln(SerialPort,res)
END
res=""
END
ELSE SAY "Can't open serial port"
EXIT
Bummer: PROCEDURE
ARG etxt
SAY "ERROR: "||RC||etxt
close(SerialPort)
EXIT
RETURN 0